<template>
  <div class="box">
    <myheader>
      <template #left> <span @click="$router.back()">返回</span></template>
    </myheader>
    <div
      v-for="value in text"
      :key="value.id"
      class="title"
      v-html="value.content"
    ></div>
    <comment :name="id"></comment>
  </div>
</template>

<script>
import comment from "@/components/comment";
import myheader from "@/components/myheader";
import { getlist } from "@/apis/news";
export default {
  props: ["id"],
  components: {
    myheader,
    comment,
  },
  data() {
    return {
      text: [],
    };
  },
  mounted() {
    // console.log(this.id);
    getlist(this.id).then((res) => {
      // console.log(res.data.message);
      this.text = res.data.message;
      console.log(this.text);
    });
  },
};
</script>

<style lang="less" scoped>
.box {
  /deep/.title {
    p {
      text-indent: 2em !important;
      margin-bottom: 10px;
    }
  }
}
</style>
